pub fn new_birthday_probability(n: u32) -> f64 {
    if n < 2 {
        return 0.0; // 至少需要两个人
    }

    let mut probability_no_collision = 1.0;
    let total_days = 365;

    for i in 0..n {
        probability_no_collision *= (total_days - i) as f64 / total_days as f64;
    }

    // 有冲突的概率 = 1 - 无冲突的概率
    1.0 - probability_no_collision
}